package com.api.shopapi.service.impl;

import com.api.shopapi.entity.LXXueYaJi;
import com.api.shopapi.mapper.LXXueYaJiMapper;
import com.api.shopapi.service.LXXueYaJiService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("LXXueYaJiServiceImplOne")
public class LXXueYaJiServiceImpl  implements LXXueYaJiService {

    @Autowired
    private LXXueYaJiMapper lxXueYaJiMapper;


    @Override
    public int insert(LXXueYaJi lxXueYaJi) {
        return lxXueYaJiMapper.insert(lxXueYaJi);
    }

    @Override
    public PageInfo<LXXueYaJi> geyByUserCode(int pageIndex, int pageSize, String userCode) {
        PageHelper.startPage(pageIndex,pageSize);
        List<LXXueYaJi> lxXueYaJiList =lxXueYaJiMapper.geyByUserCode(userCode);
        return new PageInfo<>(lxXueYaJiList);
    }
}
